/*
 * @Author: ’楚峡云归‘ longc447@gmail.com
 * @Date: 2022-10-21 01:26:21
 * @LastEditors: ’楚峡云归‘ longc447@gmail.com
 * @LastEditTime: 2022-10-21 01:35:45
 * @FilePath: /学习文档/Java/test/thread.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
public class App {
  public static void main(String[] args) {
    myThread t1 = new myThread("t1", 10);
    myThread t2 = new myThread("t2", 20);
    myThread t3 = new myThread("t3", 30);
    t1.start();
    t2.start();
    t3.start();
  }
}

class myThread extends Thread {
  String name;
  int count;

  myThread(String name) {
    this.name = name;
  }

  myThread(String name, int count) {
    this.name = name;
    this.count = count;
  }

  @Override
  public void run() {
    // TODO Auto-generated method stub
    super.run();
    for (int i = 0; i < count; i++) {
      System.out.println(this.name + " is running! ---" + i);
    }
  }
}